package com.z.base;


import java.io.Serializable;

public class PageTableRequest implements Serializable {

    private Integer page = 1;
    private Integer limit = 10;
    private Integer offset;

    public void countOffset(){
        if(page == null || limit == null){
            this.offset = 0;
            this.limit = 10;
            return;
        }
        this.offset = (this.page - 1 ) * limit;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    public Integer getOffset() {
        return offset;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }
}
